#define _USE_MATH_DEFINES

#include <cstdio>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <queue>
#include <cassert>
#include <stack>
#include <cstdlib>
#include <bitset>
#include <cmath>

#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define pb push_back
#define all(a) a.begin(),a.end()
#define sz(a) int(a.size())
#define mp make_pair

using namespace std;

typedef long long li;
typedef long double ld;

typedef pair<int,int> pt;
#define ft first
#define sc second

const int INF = int(1e9);
const li INF64 = li(1e18);
const ld EPS = 1e-9;

//#define TASK_NAME ""

char s[200];

bool read() {
	if (scanf("%s", s) <= 0)
		return false;
	if (s[0] == '#')
		return false;
	return true;
}

pair<ld,ld> sym(ld a, ld b, ld c, ld x, ld y) {
	ld s = sqrt(a * a + b * b);

	a /= s;
	b /= s;
	c /= s;

	ld d = a * x + b * y + c;
	ld nx = x - a * 2 * d;
	ld ny = y - b * 2 * d;

	return mp(nx, ny);
}

ld det(ld a11, ld a12, ld a21, ld a22) {
	return a11 * a22 - a12 * a21;
}

pair<ld,ld> cross(ld a1, ld b1, ld c1, ld a2, ld b2, ld c2) {
	ld D = det(a1, b1, a2, b2);

	ld D1 = det(-c1, b1, -c2, b2);
	ld D2 = det(a1, -c1, a2, -c2);

	return mp(D1 / D, D2 / D);
}

struct line {
	ld a, b, c;
	bool point;
	
	line() {}
	
	line(const ld x, const ld y) {
		a = x;
		b = y;
		point = true;
	}

	line(const line& p, const line& q) {
		if (p.point && q.point) {
			a = p.b - q.b;
			b = q.a - p.a;
			c = - a * p.a - b * p.b;
		}

		if (p.point ^ q.point) {
			line l = p;
			line k = q;

			if (p.point)
				swap(k, l);

			pair<ld,ld> t = sym(l.a, l.b, l.c, k.a, k.b);
			a = t.ft;
			b = t.sc;
		}			

		if (!p.point && !q.point) {
			pair <ld, ld> t = cross(p.a, p.b, p.c, q.a, q.b, q.c);
			a = t.ft;
			b = t.sc;
		}

		point = !(p.point && q.point);
	}
};

int readnum(int& pos) {
	int mul = 1, res = 0;
	if (s[pos] == '-')
		mul = -1, pos++;

	while (isdigit(s[pos])) {
		res *= 10;
		res += s[pos] - '0';
		pos++;
	}

	return res * mul;
}

void solve() {
	int len = strlen(s);

	stack <char> ops;
	stack <line> nums;

	int i = 0;

	while (i < len) {
		if (s[i] == '(' && s[i + 1] != '-' && !isdigit(s[i + 1])) {
			ops.push(s[i++]);
			continue;
		}

		if (s[i] == '(') {
			i++;
			ld x = readnum(i);
			assert(s[i++] == ',');
			ld y = readnum(i);
			assert(s[i++] == ')');
			nums.push(line(x, y));
			continue;
		}

		if (s[i] == ')') {
			while (ops.top() != '(') {
				ops.pop();
				line b = nums.top(); nums.pop();
				line a = nums.top(); nums.pop();
				nums.push(line(a, b));
			}
			ops.pop();
			i++;
			continue;
		}

		while (!ops.empty() && ops.top() != '(') {
			ops.pop();
			line b = nums.top(); nums.pop();
			line a = nums.top(); nums.pop();
			nums.push(line(a, b));
		}

		assert(s[i++] == '@');
		ops.push('@');
	}

	while (!ops.empty()) {
		ops.pop();
		line b = nums.top(); nums.pop();
		line a = nums.top(); nums.pop();
		nums.push(line(a, b));
	}

	cout << fixed << setprecision(9) << nums.top().a << " " << nums.top().b << endl;
}

int main() {
#ifdef TASK_NAME
	freopen(TASK_NAME ".in", "r", stdin);
	freopen(TASK_NAME ".out", "w", stdout);
#endif

#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif

	while (read())
		solve();

	return 0;
}